<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@page  import="Model.ProModel" %>
<%@page import="bean.Product" %>
<%@page import="java.util.*"%>

<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Product</title>
</head>
<body marginwidth="100px" bgcolor="#FFFFDD" >
<table width="100%" border="0" align="center" cellspacing="0px"  background= "../picture/background.jpg">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
	<jsp:include page="header.jsp" />	</td>
  </tr>
  <tr>
    <td>
	<table width="100%" border="0" cellspacing="0">
      <tr>
        <td width="140" valign="top" style="border-right: 2px solid #cccccc">
            <jsp:include page="left.jsp" /></td>
        <td  valign="top">
            <table width="100%" border="0">
		   
		    <tr>
		      <td>


		        <table width="100%" border="0">
                             <%
			  	  ArrayList<Product> pros = (ArrayList<Product>)request.getAttribute("searchResultPros");
                                  if(pros==null || pros.isEmpty())
                                      {
                             %>
                             <tr> <td align="center" style="font-size: 22px">khong co san pham</td></tr>
                             <%
                                  }
                                  else{
                                  Iterator<Product> it = pros.iterator();
                                  Product pro;
                                  while(it.hasNext())
                                      {pro=it.next();
			  %>
		          <tr>
		            <td>
		              <table width="100%">
		                 <tr><td align="center">
                                        <img src="../products/<%=pro.getImage()%>" style="width:200px; height:200px" />
		                  </td></tr>
                                        <tr>
                                        <td align="center">gia: <%=pro.getPrice()%> VND</td></tr>
                                        <tr>
                                        <td align="center">Hang: <%=pro.getBrand()%> ;  </td></tr>
                                        <tr>
                                         <td align="center" >
                                             <html:form  action="/client/pages/shopingCart">
                                            <% String ID = Long.toString(pro.getIDpro()); %>

                                        <html:hidden property="IDpro" value="<%=ID%>" />
                                        <html:image  src="../picture/giohang.png" property="submit"/>
                                        </html:form>
                                         </td></tr>
		                </table>
                            </td>
                            <td>
                                <%if(it.hasNext()){ pro=it.next(); %>
                              <table width="100%">
		                <tr><td align="center">
                                        <img src="../products/<%=pro.getImage()%>" style="width:200px; height:200px"/>
		                  </td></tr>
                                        <tr>
                                        <td align="center">gia: <%=pro.getPrice()%> VND</td></tr>
                                        <tr>
                                        <td align="center">Hang: <%=pro.getBrand()%> ;  </td></tr>
                                        <tr>
                                         <td align="center" >
                                        <html:form   action="/client/pages/shopingCart">
                                            <% String ID1 = Long.toString(pro.getIDpro()); %>

                                        <html:hidden property="IDpro" value="<%=ID1%>" />
                                        <html:image  src="../picture/giohang.png"  property="submit"/>
                                        </html:form>
                                        </td></tr>
                              </table><% }%>
                            </td>

                          </tr>
		            <% } }%>
                        </table>
                            </td>
                    </tr>
	            </table>
              </td>
                         <td width="100" valign="top" style="border-left: 2px solid #cccccc" >
                             <jsp:include page="right.jsp" /></td>
              </tr>
	      </table>

        </td>

      </tr>

  <tr>
    <td>footer</td>
  </tr>
</table>
</body>
</html>
